import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBShop028_删除标签组"
hw='华为老大'

# 后台登录，商品管理,商品标签,商品标签分组
dr=openBrowser(urlAdmin)
DBshopLoginAdmin(dr)
DBshopEnterMenu3(dr,"商品管理","商品标签","商品标签分组")

# 1.点击“删除”按钮，确定删除，删除成功。
dr.find_element_by_xpath('//td[contains(.,"%s")]/following-sibling::td[4]/a[2]'% hw).click()
dr.switch_to.alert.accept()
time.sleep(3)

try:
    dr.find_element_by_xpath('//td[contains(.,"%s")]'% hw).is_displayed()
    writeLog('%s 测试不通过' % testCase)
    getPhoto(dr)
except:
    writeLog('%s 测试通过' % testCase)
    print('测试通过')
dr.quit()